// form 样式
layui.use(['element' , 'form' , 'laydate'], function() {
    var element = layui.element;
    var form = layui.form;
    var laydate = layui.laydate;
    laydate.render({
        elem: '.test-item',
        trigger: 'click',
    });
});

//选中样式
$('.label-nav-con li').click(function() {
    $(this).addClass('current').siblings().removeClass('current');
})
//保存健康档案体格检查信息
function savePhysiqueHealthyInfo(url) {
    //获取数据信息
    var physiqueCheckForm =new FormData(document.getElementById("physiqueCheckForm"));
    layui.use('layer', function(){
        var layer = layui.layer;
        var loading;

        // layer.confirm('确定保存吗？', {
        //     btn: ['确定','取消'] //按钮
        // }, function(){
        //
        // }, function(){
        //     layer.close(layer.index);
        // });
        $.ajax({
            url:getRootPath_web()
                +'healthArchive/elderly/savePhysiqueCheckInfo',
            type:'post',
            dataType:'json',
            data:physiqueCheckForm,
            processData: false,
            contentType: false,
            beforeSend:function () {
                loading = layer.load(1, {
                    shade: [0.9,'#fff']
                    ,shadeClose:false
                });
            },
            success:function (result) {
                if(result.code=='0000'){
                    layer.confirm('保存成功', {
                        btn: ['确定'] //按钮
                        ,shadeClose: false
                        ,closeBtn:false
                    }, function(){
                        layer.closeAll();
                        window.location.href=getRootPath_web()
                            +url;
                    })
                }else {
                    layer.confirm(result.codeDesc, {
                        btn: ['确定'] //按钮
                        ,shadeClose: false
                        ,closeBtn:false
                    }, function(){
                        layer.close(layer.index);
                        layer.close(loading);
                    })
                }
            }
        })
    });
}

//上一步
function previousStep(url) {
    var userNo =$("#userNo").val();
    window.location.href=getRootPath_web()+
        url+"?userNo="+userNo;
}
//返回
function returnToList(url) {
    window.location.href = getRootPath_web()
        + url;
}
//查询护理详情
function nursingInfo() {
    layui.use(['layer'], function() {
        var layer = layui.layer;
        layer.open({
            type: 1,
            title: false, //不显示标题栏
            closeBtn: false,
            area: ["$('div#pop-con') + width() + 'px'", ''],
            shade: 0.6,
            id: 'payCons', //设定一个id，防止重复弹出
            /*,btn: ['确认支付']*/
            btnAlign: 'c',
            moveType: 1, //拖拽模式，0或者1
            shadeClose: true, //设置允许点遮罩关闭
            content: $("div#pop-con"),
            success: function() {
                //关闭弹层
                $(".pop-close").click(function() {
                    layer.closeAll();
                });
            },

        });
    });
}